<?php 
include "includes/session.php";
include "includes/comunes.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<?php include "includes/metas.php"?>
<!--
  fin estilo scroll-->


<script language="JavaScript" type="text/javascript">
$(function()
{

//        funcion que implementa combos
	$('#rubro').chainSelect('#subrubro','comborubrosubrubro.php',
	{
		before:function (target) //before request hide the target combobox and display the loading message
		{
			$("#loading").css("display","block");
			$(target).css("display","none");
		},
		after:function (target) //after request show the target combobox and hide the loading message
		{
			$("#loading").css("display","none");
			$(target).css("display","inline");
		}
	});
        
    $( "#menu" ).menu({position: {at: "left bottom"}});
           
		$("#codigo").autocomplete({
			source: "autoArticulos.php"
		});   
		

});
</script>

</head>

<body>

<div class="container">
<?php include "includes/head.php"?>
   <div class="content">
       <div class="tituloprincipal">
          <?php include 'includes/submenu.php';?>  
           <img src="img/nuevo.png" width="25" height="25" border="0"/> Nuevo Producto
           </div>
       <form id="pedido" name="pedido" method="POST" action="grabarProducto.php">
       <div class="contenedorpedido">
           <div id="vendedor">
           <fieldset>
              <legend><b>Datos del Producto</b></legend> 
               <table  width="100%">
                 <tr>
                      <td class="textotablamenuform">Codigo</td>
                      <td class="textotablamenuform">
                          <input type="text" class="campo_form"  id="codigo" name="codigo" required>
                      </td>
                      <td class="textotablamenuform"></td>
                      <td class="textotablamenuform">
                      </td>
                      
                 </tr>
                   <tr>
                      <td class="textotablamenuform">Descripcion</td>
                      <td class="textotablamenuform" colspan="5">
                           <input type="text" class="campo_form"  id="nombre" name="nombre" required>
                               
                      </td> 
                   </tr>
                   
                   <tr>
                      <td class="textotablamenuform">Costo</td>
                      <td class="textotablamenuform">
                          <input type="number" step="0.1" class="campo_form" required id="costo" name="costo">
                    
                      </td>
                      <td class="textotablamenuform">Precio</td>
                      <td class="textotablamenuform">
                          <input type="number" class="campo_form" step="0.1" required id="precio" name="precio">
                    
                      </td>
                      <td class="textotablamenuform">Stock Minimo</td>
                      <td class="textotablamenuform" >
                           <input type="number" class="campo_form"  value="0" required id="stock" name="stock" >
                    
                      </td>
                 </tr>
                   <tr>
                      
                      <td class="textotablamenuform">Precio 1</td>
                      <td class="textotablamenuform">
                           <input type="number" class="campo_form"  step="0.1" value="0" required id="precio1" name="precio1" >
                    
                      </td>
                       <td class="textotablamenuform">Precio 2</td>
                      <td class="textotablamenuform" >
                           <input type="number" class="campo_form"  step="0.1" value="0"  required id="precio2" name="precio2" >
                    
                      </td>
                      <td class="textotablamenuform">Marca</td>
                      <td class="textotablamenuform" colspan="2">
                           <select class="campo_form" name="marca" id="marca" required>
						   
						   <?php 
						   $resRub=obtener_marcas();
						   while($regRub=mysql_fetch_array($resRub)):?>
						   <option value="<?php echo $regRub['id']?>"><?php echo $regRub['Nombre']?></option>
						   <?php endwhile ?>
						  </select>
                    
                      </td>
                 </tr>
				 <tr>
                      
                      <td class="textotablamenuform">Rubro</td>
                      <td class="textotablamenuform" >
                           <select class="campo_form" name="rubro" id="rubro" required>
						   <option value=0>Seleccionar..</option>
						   <?php 
						   $resRub=obtener_rubros();
						   while($regRub=mysql_fetch_array($resRub)):?>
						   <option value="<?php echo $regRub['id']?>"><?php echo $regRub['Nombre']?></option>
						   <?php endwhile ?>
						  </select>
                    
                      </td>
                       <td class="textotablamenuform">Sub Rubro</td>
                      <td class="textotablamenuform">
                          <select class="campo_form" name="subrubro" id="subrubro"  style="display:none:">
						  </select>
                    
                      </td>
                       <td class="textotablamenuform" colspan="3"></td>
                 </tr>
				 <tr>
				 <td class="textotablamenuform">
				 Observacion
				 </td>
				 <td colspan="4">
				 <textarea name="venObse" cols="65" class="campo_form"></textarea>
				 </td>
				 </tr>
                   
                   
                   
               </table>    
           </fieldset>  
           </div>
           
        
           <fieldset style="text-align: right;">  
            <table style="text-align: right;">
             <tr>
                    <td class="textotablamenuform" style="text-align: right;" colspan="5">
                         <input type="reset" name="enviar" value="Limpiar"  class="boton_form"/>
                         <input name="submit" id="submit" type="submit" value="Grabar Articulo" class="boton_form"/>
                     </td>
                 </tr>
                   </table>       
           </fieldset>  
           
           
           
       </div>
   </form>
       <div class="clear"></div>
   <br>
   </div>
  <?php include "includes/pie.php"?>
  
</div>
</body>
</html>
